package com.cms.breakpad

import android.content.Context
import android.util.Log
import java.io.File

class NativeLib {

    /**
     * A native method that is implemented by the 'breakpad' native library,
     * which is packaged with this application.
     */
    external fun stringFromJNI(): String

    companion object {
        // Used to load the 'breakpad' library on application startup.
        init {
            System.loadLibrary("bugly")
        }


    }
    fun initContext(context:Context) {
        val applicationContext = context.applicationContext
        val file = File(applicationContext.externalCacheDir,"native_crash${System.currentTimeMillis()}")
        Log.i("111", "initContext: ${file.absolutePath}")
        if (!file.exists()){
            file.mkdirs()
        }
        initBreakpad(file.absolutePath)
    }
    external fun initBreakpad(path:String)
    external fun testNativeCrash()
}